<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
    <title>湖南省自来水公司营销管理信息系统</title>
    <link rel="stylesheet" href="../layui/css/layui.css">
    <link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" title="no title"/>
    <link rel="stylesheet" href="../css/text.css" type="text/css" media="screen" title="no title"/>
    <link rel="stylesheet" href="../css/form.css" type="text/css" media="screen" title="no title"/>
    <link rel="stylesheet" href="../css/buttons.css" type="text/css" media="screen" title="no title"/>
    <link rel="stylesheet" href="../css/grid.css" type="text/css" media="screen" title="no title"/>
    <link rel="stylesheet" href="../css/layout.css" type="text/css" media="screen" title="no title"/>

    <link rel="stylesheet" href="../css/ui-darkness/jquery-ui-1.8.12.custom.css" type="text/css" media="screen"
          title="no title"/>
    <link rel="stylesheet" href="../css/plugin/jquery.visualize.css" type="text/css" media="screen" title="no title"/>
    <link rel="stylesheet" href="../css/plugin/facebox.css" type="text/css" media="screen" title="no title"/>
    <link rel="stylesheet" href="../css/plugin/uniform.default.css" type="text/css" media="screen" title="no title"/>
    <link rel="stylesheet" href="../css/plugin/dataTables.css" type="text/css" media="screen" title="no title"/>

    <link rel="stylesheet" href="../css/custom.css" type="text/css" media="screen" title="no title">
    <script src="/webjars/vue/2.5.17/dist/vue.js"></script>
    <style type="text/css">
        tr.disabled td {
            color: #999999;
        }
    </style>
</head>

<body>
<div id="wrapper">


    <div id="bool"><script>window.onload=function (){  $("#bool").load("../ming.html");}</script></div>


    <div id="app">
        <div id="content" class="xgrid">


            <div class="x12">

                <h2>发票补开/作废</h2>

                <div class="height40">
                    发票保管员
                    <select class="medium" id="empid">
                    <option selected="selected" value="0">所有</option>
                    <option v-for="emp in empList" :value="emp.id">{{emp.empNmae}}</option>
                </select>
                    发票号码 <input type="text" id="invoiceNo"/>
                    使用日期 <input type="date" id="useDate"/>
                    <button class="btn btn-small btn-icon btn-find" @click="findBy()"><span></span>查询</button>
                </div>

                <table class="data display">
                    <thead>
                    <tr>
                        <th>发票类型</th>
                        <th>状态</th>
                        <th>发票号码</th>
                        <th>交费单号</th>
                        <th>交费用户</th>
                        <th>收费员</th>
                        <th>交费金额</th>
                        <th>交费/作废日期</th>
                        <th>是否交票</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr class="odd" v-for="pypay in PyPayList">
                        <td><span v-if="pypay.ivInvoice.invoiceType==0">普通发票</span><span
                                v-if="pypay.ivInvoice.invoiceType==1">增值税发票</span></td>
                        <td><span v-if="pypay.ivInvoice.used==0">未使用</span><span
                                v-if="pypay.ivInvoice.used==1">已使用</span></td>
                        <td v-text="pypay.ivInvoice.invoiceNo"></td>
                        <td v-text="pypay.payNo"></td>
                        <td v-text="pypay.usUser.username"></td>
                        <td v-text="pypay.syEmp.empNmae">/td>
                        <td class="right"><span v-text="pypay.payMoney"></span>元</td>
                        <td v-text="pypay.payDate"></td>
                        <td><span v-if="pypay.ivInvoice.archived==0">否</span><span
                                v-if="pypay.ivInvoice.archived==1">是</span></td>
                        <td class="center">
                            <span v-if="pypay.ivInvoice.archived==1">已交票不能操作</span>
                            <span v-if="pypay.ivInvoice.archived==0">
                            <span v-if="pypay.ivInvoice.invalid==0">
                                <button class="btn-icon btn-small btn-blue btn-star"
                                        @click="reInvoice(pypay.payNo)"><span></span>补开
                            </button>
                            </span>
                                <span v-if="pypay.ivInvoice.invalid==1">已作废</span>
                            </span>
                            </span>
                        </td>
                    </tr>
                    </tbody>
                </table>

            </div> <!-- .x12 -->

        </div> <!-- #content -->
    </div>
    <div id="footer">
        <div class="content_pad">
            <p>&copy; 2013-11 版权所有 <a href="#">湖南省自来水公司</a>. 技术支持 <a href="#">职业教育</a>.</p>
        </div> <!-- .content_pad -->
    </div> <!-- #footer -->

</div> <!-- #wrapper -->
<script src="../layui/layui.all.js"></script>
<script>
    //条件查询交费单信息
    function findAll(empno,invoiceNo,useDate) {
        var index = layer.load(0, {shade: false});
        $.ajax({
            type: 'GET',
            url: "/py-pay/findAll",
            data:{"EmpID":empno,"invoice":invoiceNo,"PayDate":useDate},
            dataType: 'json',
            success: function (json) {
                if (json.code == 200) {
                    app.PyPayList = json.data.PyPayList;
                    app.PyPayList = json.data.PyPayList;
                } else {
                    layer.msg(json.message, {icon: 2})
                }
                layer.close(index);
            },
        });
    }
    //查询所有收费部员工
    function findAllEmp() {
        $.ajax({
            type: 'GET',
            url: "/py-pay/findAllEmp",
            // data:,
            dataType: 'json',
            success: function (json) {
                if (json.code == 200) {
                    app.empList = json.data.empList;
                } else {
                    layer.msg(json.message, {icon: 2})
                }
            },
        });
    }
    var $ = layui.jquery,
        layer = layui.layer,
        form = layui.form;
    table = layui.table;
    var app = new Vue({
        el: "#app",
        data: {
            PyPayList: '',//交费单集合
            empList:'',//员工集合
        }, methods: {
            //发票补开
            reInvoice(payNo) {
                    var index = layer.open({
                        area: ['70%', '80%'],
                        resize: false,
                        shadeClose: true,
                        type: 2,
                        btn: ["关闭"],
                        scrollbar: false,
                        content: 'pay_window_reInvoice.html?payNo='+payNo,
                        // content: 'pay_invoiceReprint_reprint.html',
                    });
            },
            //条件查询
            findBy(){
                var empno = $("#empid option:selected").val();
                var invoiceNo = $("#invoiceNo").val();
                var useDate = $("#useDate").val();
                findAll(empno,invoiceNo,useDate);
            },
        },
        created() {
            findAll();
            findAllEmp();
        },
    });
</script>

<script src="../js/jquery/jquery-1.5.2.min.js"></script>
<script src="../js/jquery/jquery-ui-1.8.12.custom.min.js"></script>
<script src="../js/misc/excanvas.min.js"></script>
<script src="../js/jquery/facebox.js"></script>
<script src="../js/jquery/jquery.visualize.js"></script>
<script src="../js/jquery/jquery.dataTables.min.js"></script>
<script src="../js/jquery/jquery.tablesorter.min.js"></script>
<script src="../js/jquery/jquery.uniform.min.js"></script>
<script src="../js/jquery/jquery.placeholder.min.js"></script>

<script src="../js/widgets.js"></script>
<script src="../js/dashboard.js"></script>

<script type="text/javascript">

    $(document).ready(function () {
        Dashboard.init();
    });

</script>

</body>

</html>